﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace EmployeeLeaveSystem.Shared.Models {
    public class LeaveDetail {
        public int Id { get; set; }
        public string Name { get; set; } = "【新建请假单】";
        public DateTime LeaveDate { get; set; } = DateTime.Now; //请假发起日期
        public int? StaffId { get; set; }
        public StaffInfo? Staff { get; set; } // 发出申请人
        public int? AcceptStaffId { get; set; }
        public StaffInfo? AcceptStaff { get; set; } // 审核确认人

        public LeaveType Type { get; set; } // 请假类型
        public DateTime StartTime { get; set; } //请假发起时间
        public DateTime EndTime { get; set; } //请假结束时间，（隐式包含，请假时间长度）
        public String Description { get; set; } = "";//请假原因描述
        public AcceptFlag AcceptFlag { get; set; } = AcceptFlag.审核中;//请假确认标志

        public List<Comments> Comments { get; set; } = new();
    }
    public enum LeaveType { CasualLeave = 1, SickLeave, Business, PaidLeave }
    //01-事假，02-病假，03-出差，04-带薪休假
    public enum AcceptFlag {
        [Display(Name = "审核中")]
        审核中,
        [Display(Name = "接受")]
        接受,
        [Display(Name = "正常结束")]
        正常结束,
        [Display(Name = "驳回")]
        驳回
    }
    // 发起中，接受假期，请假结束
}
